using UnityEditor;

namespace GameCore
{
    [CustomEditor(typeof(AudioManager), editorForChildClasses: true)]
    public class AudioManagerEditor : Editor
    {
        private AudioManager self;

        private void OnEnable()
        {
            self = (AudioManager)target;
        }

        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            EditorGUI.BeginChangeCheck();
            self.MasterVolume = EditorGUILayout.Slider("MasterVolume", self.MasterVolume, 0f, 1f);
            self.MusicVolume = EditorGUILayout.Slider("MusicVolume", self.MusicVolume, 0f, 1f);
            self.SoundVolume = EditorGUILayout.Slider("SoundVolume", self.SoundVolume, 0f, 1f);
            if (EditorGUI.EndChangeCheck())
                EditorUtility.SetDirty(self);
        }
    }
}